package com.example.demo.controller;

import com.example.demo.dao.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

@Controller
public class PageController {

    @RequestMapping("index")
    public String open(Model model){
        List<Student> list = new ArrayList<Student>();
        for(int i=0;i<10;i++){
            Student student = new Student();
            student.setName("张三丰"+i);
            student.setAge(18+i);
            student.setGender("男");
            list.add(student);
        }
        model.addAttribute("list", list);
        return "open";
    }

}
